#![allow(unused, dead_code)]

use crate::utils::load_xmind;
mod xmind;
mod utils;
mod testcase;

fn main() {
    let args: Vec<String> = std::env::args().skip(1).collect();
    if args.is_empty() {
        println!("Please input xmind file path");
        return;
    }

    let path = std::path::PathBuf::from(args.get(0).unwrap());
    let xmind = match load_xmind(&path) {
        Ok(xmind) => xmind,
        Err(e) => {
            println!("Error: {}", e);
            return;
        },
    };

    let test_cases = xmind.convert_to_test_cases();
    utils::write_xlsx(test_cases, path);
}
